﻿Imports BLL
Public Class ThemMonAn
    Dim dsmonan As IList
    Public ds_monAn As New List(Of MonAn)

    Private Sub ThemMonAn_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim monanbus As New MonAn_BLL()
        dsmonan = monanbus.LayDanhSach()
        gridMonAn.DataSource = dsmonan
    End Sub

    Private Sub btnThem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnThem.Click
        Try
            Dim n As Integer = gridMonAn.CurrentCell.RowIndex
            ds_monAn.Add(dsmonan.Item(n))
            MessageBox.Show("Thêm thành công !", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
        Catch ex As Exception
            MessageBox.Show("Thêm thất bại !" + vbNewLine + ex.Message, "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
        End Try
    End Sub

    Private Sub ButtonX1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonX1.Click
        Me.Close()
    End Sub
End Class